package com.huazai.work;

import java.lang.reflect.Array;
import java.util.*;

/**
 * @author EZTTU
 */
public class Main {
    public static void main(String[] args) {


        System.out.println(new Solution().isPalindrome(1231));
    }
}
class Solution {
    public boolean isPalindrome(int x) {

        if (x < 0 || (x % 10 == 0 && x!=0)) {
            return false;
        }

        int res = 0;
        while (res < x) {
            res = res*10 + x%10;
            x = x/10;
        }

        System.out.println(res);
        System.out.println(x);



        return res / 10 == x || res == x;
    }
}